<!--
	This file is part of ELCube.
	ELCube is free software: you can redistribute it and/or modify
	it under the terms of the GNU Affero General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.
	ELCube is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Affero General Public License for more details.
	You should have received a copy of the GNU Affero General Public License
	along with ELCube.  If not, see <https://www.gnu.org/licenses/>.
-->
<template>
    <nk-def-card>
        <nk-form :edit="editMode" :col="2">
            <nk-form-item title="触发条件" :col="2">
                <nk-sp-el-view :el="def.conditionSpEL"></nk-sp-el-view>
                <nk-sp-el-editor slot="edit" v-model="def.conditionSpEL" placeholder="触发条件"></nk-sp-el-editor>
            </nk-form-item>
            <nk-form-item title="财务引擎卡片key" :col="2">
                {{def.engineCardKey}}
                <a-input slot="edit" size="small" v-model="def.engineCardKey" placeholder="财务引擎卡片key"></a-input>
            </nk-form-item>

            <nk-form-divider title="接口属性"></nk-form-divider>
            <nk-form-item title="接口账号" :required="true" :validate-for="def.attrs.account">
                {{def.attrs.account}}
                <a-input slot="edit" size="small" v-model="def.attrs.account"></a-input>
            </nk-form-item>
            <nk-form-item title="接口类型" :required="true" :validate-for="def.attrs.billtype">
                {{def.attrs.billtype}}
                <a-input slot="edit" size="small" v-model="def.attrs.billtype"></a-input>
            </nk-form-item>
            <nk-form-item title="groupcode" :required="true" :validate-for="def.attrs.groupcode">
                {{def.attrs.groupcode}}
                <a-input slot="edit" size="small" v-model="def.attrs.groupcode"></a-input>
            </nk-form-item>
            <nk-form-item title="orgcode" :required="true" :validate-for="def.attrs.orgcode">
                {{def.attrs.orgcode}}
                <a-input slot="edit" size="small" v-model="def.attrs.orgcode"></a-input>
            </nk-form-item>
            <nk-form-item title="sender" :required="true" :validate-for="def.attrs.sender">
                {{def.attrs.sender}}
                <a-input slot="edit" size="small" v-model="def.attrs.sender"></a-input>
            </nk-form-item>

            <nk-form-divider title="抬头字段"></nk-form-divider>
            <nk-form-item title="凭证类别" :required="true" :validate-for="def.heads.pk_vouchertype">
                {{def.heads.pk_vouchertype}}
                <a-input slot="edit" size="small" v-model="def.heads.pk_vouchertype"></a-input>
            </nk-form-item>
            <nk-form-item title="凭证类型值" :required="true" :validate-for="def.heads.voucherkind">
                {{def.heads.voucherkind}}
                <a-input slot="edit" size="small" v-model="def.heads.voucherkind"></a-input>
            </nk-form-item>
            <nk-form-item title="来源系统" :required="true" :validate-for="def.heads.pk_system">
                {{def.heads.pk_system}}
                <a-input slot="edit" size="small" v-model="def.heads.pk_system"></a-input>
            </nk-form-item>
            <nk-form-item title="所属集团" :required="true" :validate-for="def.heads.pk_group">
                {{def.heads.pk_group}}
                <a-input slot="edit" size="small" v-model="def.heads.pk_group"></a-input>
            </nk-form-item>
            <nk-form-item title="所属组织" :required="true" :validate-for="def.heads.pk_org">
                {{def.heads.pk_org}}
                <a-input slot="edit" size="small" v-model="def.heads.pk_org"></a-input>
            </nk-form-item>
            <nk-form-item title="所属组织版本">
                {{def.heads.pk_org_v}}
                <a-input slot="edit" size="small" v-model="def.heads.pk_org_v"></a-input>
            </nk-form-item>
            <nk-form-item title="核算账簿" :required="true" :validate-for="def.heads.pk_accountingbook">
                {{def.heads.pk_accountingbook}}
                <a-input slot="edit" size="small" v-model="def.heads.pk_accountingbook"></a-input>
            </nk-form-item>
            <nk-form-item title="签字标志">
                {{def.heads.signflag}}
                <a-input slot="edit" size="small" v-model="def.heads.signflag"></a-input>
            </nk-form-item>

            <nk-form-item title="附单据数">
                {{def.heads.attachmentSpEL}}
                <nk-sp-el-editor slot="edit" v-model="def.heads.attachmentSpEL"></nk-sp-el-editor>
            </nk-form-item>
            <nk-form-item title="凭证号">
                {{def.heads.noSpEL}}
                <nk-sp-el-editor slot="edit" v-model="def.heads.noSpEL"></nk-sp-el-editor>
            </nk-form-item>
            <nk-form-item title="制单人">
                {{def.heads.pk_preparedSpEL}}
                <nk-sp-el-editor slot="edit" v-model="def.heads.pk_preparedSpEL"></nk-sp-el-editor>
            </nk-form-item>


        </nk-form>
    </nk-def-card>
</template>

<script>
    import MixinDef from "MixinDef";

    export default {
        mixins:[new MixinDef({
            attrs:{},
            heads:{},
            // heads:[
            //     {key:"pk_voucher",          desc:"凭证主键,空表示新凭证"},
            //     {key:"pk_vouchertype",      desc:"凭证类别 非空"},
            //     {key:"voucherkind",         desc:"凭证类型值 非空"},
            //     {key:"pk_system",           desc:"来源系统 非空"},
            //     {key:"pk_group",            desc:"所属集团 默认为当前登陆集团"},
            //     {key:"pk_org",              desc:"所属组织 非空"},
            //     {key:"pk_org_v",            desc:"所属组织版本"},
            //     {key:"pk_accountingbook",   desc:"核算账簿 非空"},
            //     {key:"year",                desc:"会计年度 非空"},
            //     {key:"period",              desc:"会计期间 非空"},
            //     {key:"signflag",            desc:"签字标志"},
            //     {key:"attachment",          desc:"附单据数"},
            //     {key:"no",                  desc:"凭证号为空自动分配 非空：按凭证号处理"},
            //     {key:"pk_prepared",         desc:"制单人（用户） 非空"},
            //     {key:"prepareddate",        desc:"制单日期 非空 YYYY-MM-dd HH:mm:ss"},
            //     {key:"pk_casher",           desc:"出纳（用户）"},
            //     {key:"pk_checked",          desc:"审核人（用户）"},
            //     {key:"pk_manager",          desc:"记账人（用户）"},
            //     {key:"tallydate",           desc:"记账日期"},
            //     {key:"discardflag",         desc:"作废标志"},
            // ],
            details:[]
        })],
        computed:{
        },
        created() {
            this.def.attrs = this.def.attrs || {};
            this.def.heads = this.def.heads || {};
        },
        methods:{
        }
    }
</script>

<style scoped>

</style>